import { S } from '../../s';
import { IPSAppDEACMode } from '../../app/dataentity/ipsapp-deacmode';
import { IPSAppDEField } from '../../app/dataentity/ipsapp-defield';
import { IPSAppView } from '../../app/view/ipsapp-view';
import { IPSDEACMode } from './ipsdeacmode';
import { IPSDEACModeDataItem } from './ipsdeacmode-data-item';
import { IPSLanguageRes } from '../../res/ipslanguage-res';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEACModeImpl
  extends PSModelObjectImpl
  implements IPSDEACMode, IPSAppDEACMode
{
  get aCType(): 'AUTOCOMPLETE' | 'CHATCOMPLETION' {
    return this.M.aCType || 'AUTOCOMPLETE';
  }

  get codeName(): string {
    return this.M.codeName;
  }

  get emptyText(): string {
    return this.M.emptyText;
  }

  protected emptytextpslanguageres: IPSLanguageRes;
  getEmptyTextPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.emptytextpslanguageres ||
      (this.emptytextpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getEmptyTextPSLanguageRes,
        S._2b4,
      ) as IPSLanguageRes)
    );
  }

  protected itempssyspfplugin: IPSSysPFPlugin;
  getItemPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.itempssyspfplugin ||
      (this.itempssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getItemPSSysPFPlugin,
        S._353,
      ) as IPSSysPFPlugin)
    );
  }

  get logicName(): string {
    return this.M.logicName;
  }

  get minorSortDir(): 'ASC' | 'DESC' {
    return this.M.minorSortDir;
  }

  protected minorsortpsappdefield: IPSAppDEField;
  getMinorSortPSAppDEField(): IPSAppDEField | null {
    return (
      this.minorsortpsappdefield ||
      (this.minorsortpsappdefield = this.fillObjectModel(
        S._1,
        this.M.getMinorSortPSAppDEField,
        S._2b9,
      ) as IPSAppDEField)
    );
  }

  protected psdeacmodedataitems: IPSDEACModeDataItem[];
  getPSDEACModeDataItems(): IPSDEACModeDataItem[] | null {
    return (
      this.psdeacmodedataitems ||
      (this.psdeacmodedataitems = this.fillChildListModel(
        this.M.getPSDEACModeDataItems,
        S._295,
      ) as IPSDEACModeDataItem[])
    );
  }

  findPSDEACModeDataItem(objKey: any): IPSDEACModeDataItem | null {
    return this.getPSModel5(
      S._295,
      this.getPSDEACModeDataItems(),
      objKey,
    ) as IPSDEACModeDataItem;
  }

  get pagingSize(): number {
    return this.M.pagingSize;
  }

  protected pickuppsappview: IPSAppView;
  getPickupPSAppView(): IPSAppView | null {
    return (
      this.pickuppsappview ||
      (this.pickuppsappview = this.fillObjectModel(
        S._1e,
        this.M.getPickupPSAppView,
        S._316,
      ) as IPSAppView)
    );
  }

  protected textpsappdefield: IPSAppDEField;
  getTextPSAppDEField(): IPSAppDEField | null {
    return (
      this.textpsappdefield ||
      (this.textpsappdefield = this.fillObjectModel(
        S._1,
        this.M.getTextPSAppDEField,
        S._2bb,
      ) as IPSAppDEField)
    );
  }

  protected valuepsappdefield: IPSAppDEField;
  getValuePSAppDEField(): IPSAppDEField | null {
    return (
      this.valuepsappdefield ||
      (this.valuepsappdefield = this.fillObjectModel(
        S._1,
        this.M.getValuePSAppDEField,
        S._2bc,
      ) as IPSAppDEField)
    );
  }

  get defaultMode(): boolean {
    return this.M.defaultMode;
  }

  get enableBackend(): boolean {
    return this.M.enableBackend != null ? this.M.enableBackend : false;
  }

  get enablePagingBar(): boolean {
    return this.M.enablePagingBar;
  }
  get cls(): string {
    return 'PSDEACModeImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1f6 || cls == S._1f7) return true;
    return super.instanceof(cls);
  }
}
